//
//  TCNetworkTool.h
//  demo
//
//  Created by 王戈 on 15/6/10.
//  Copyright (c) 2015年 nice. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void (^NetDownLoadFailureBlock)(NSString *failureMessage);
typedef void (^NetDownLoadSuccessBlock)(NSString *successMessage);
typedef void (^NetDownLoadSuccessIdBlock)(id successMessage);
typedef void (^NetDownLoadSuccessArrayBlock)(NSArray *resultArray);
typedef void (^NetDownLoadSuccessDicBlock)(NSDictionary *resultDic);

@interface TCNetworkTool : NSObject

@property (nonatomic ,copy) NSString *token;

+ (TCNetworkTool *)sharedNetTool;

/**
 *  上传图片接口
 *
 *  @param image   待上传图片
 *  @param success 成功
 *  @param failure 失败
 */
- (void)uploadImage:(UIImage *)image andSuccessBlocks:(NetDownLoadSuccessBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;


/**
 *  获取当前所在城市ID
 *
 *  @param location 坐标
 */
- (void)getCityIDWithLocation:(NSString *)location andSuccessBlocks:(NetDownLoadSuccessDicBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  重置密码
 *  @param newPassword     新密码
 *  @param confirmPassword 确认密码
 */
- (void)setPasswordWithCellPhone:(NSString *)phoneNum VerifyCode:(NSString *)verify NewPasswork:(NSString *)newPassword confirmPassword:(NSString *)confirmPassword andSuccessBlocks:(NetDownLoadSuccessBlock)setSuccess andFailureBlocks:(NetDownLoadFailureBlock)setFailure;

/**
 *  注册
 *
 *  @param email           用户邮箱
 *  @param password        密码
 *  @param confirmPassword 确认密码
 *  @param verifyCode      手机确认码
 *  @param CityId          城市ID
 */
- (void)registerWithPhoneNum:(NSString *)phoneNum Email:(NSString *)email password:(NSString *)password confirmPassword:(NSString *)confirmPassword verifyCode:(NSString *)verifyCode CityId:(NSString *)CityId
            andSuccessBlocks:(NetDownLoadSuccessIdBlock)modifySuccess andFailureBlocks:(NetDownLoadFailureBlock)modifyFailure;

/**
 *  获取验证码
 *
 *  @param number        手机号码
 */
- (void)verifyCodeWithCallNumber:(NSString *)number andSuccessBlocks:(NetDownLoadSuccessBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  获取重置验证码
 *
 *  @param number        手机号码
 */
- (void)verifyCodeResetWithCallNumber:(NSString *)number andSuccessBlocks:(NetDownLoadSuccessBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  获取区域信息
 *
 *  @param parentID 父类ID 默认为1
 */
- (void)areaWithParentID:(NSString *)parentID andSuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  登录
 *
 *  @param email           用户名
 *  @param password        密码
 */
- (void)tokenWithEmail:(NSString *)email password:(NSString *)password andSuccessBlocks:(NetDownLoadSuccessIdBlock)registerSuccess andFailureBlocks:(NetDownLoadFailureBlock)registerFailure;


/**
 *  获取用户信息
 */
- (void)getUserinfoWithSuccessBlocks:(NetDownLoadSuccessIdBlock)getSuccess andFailureBlocks:(NetDownLoadFailureBlock)getFailure;


#pragma mark - 商铺相关
/**
 *  获取商铺列表
 *
 *  @param pn      商铺列表
 */
- (void)rentListWithPn:(NSString *)pn andSuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  获取商铺详细信息
 *
 *  @param ID      商铺ID
 */
- (void)rentDetailWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessDicBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  首页
 *
 */
- (void)getHomeAdvertiseSuccessBlocks:(NetDownLoadSuccessDicBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  尾货
 *
 */
- (void)getTailListWithPn:(NSString *)pn andDataType:(NSString *)type andCity:(NSString *)cityid SuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  尾货详情
 *
 *  @param proId   尾货ID
 *  @param success 成功
 *  @param failure 失败
 */
- (void)getTailDetailInfoWithId:(NSString *)proId SuccessBlocks:(NetDownLoadSuccessDicBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  获取工作列表
 *
 *  @param success <#success description#>
 *  @param failure <#failure description#>
 */
- (void)getJobListWithPn:(NSString *)pn andCity:(NSString *)cityid SuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  获取工作列表
 *
 *  @param success <#success description#>
 *  @param failure <#failure description#>
 */
- (void)getMarketListWithPn:(NSString *)pn andCity:(NSString *)cityid SuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  获取工作列表
 *
 *  @param success <#success description#>
 *  @param failure <#failure description#>
 */
- (void)getShopListWithPn:(NSString *)pn andCity:(NSString *)cityid SuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  获取分类列表
 */
- (void)categoryListWithSuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  根据分类获取公司详细信息
 *
 *  @param ID      分类ID
 */
- (void)categoryGetAllCompanyWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  添加收藏
 *
 *  @param ID            表主键 可不传
 *  @param userID        不知道是毛 可不穿
 *  @param type          类型
 *  @param typeID        收藏对象的ID
 *  @param addTime       添加时间
 */
- (void)addFavouritesWithId:(NSString *)ID andUserId:(NSString *)userID andCollectType:(kTCCollectType)type andTypeID:(NSString *)typeID andAddTime:(NSString *)addTime andSuccessBlocks:(NetDownLoadSuccessBlock)addSuccess andFailureBlocks:(NetDownLoadFailureBlock)addFailure;
/**
 *  查看收藏列表
 *
 *  @param pn           页数
 */
- (void)favouritetListWithPn:(NSString *)pn andSuccessBlocks:(NetDownLoadSuccessArrayBlock)querySuccess andFailureBlocks:(NetDownLoadFailureBlock)queryFailure;
/**
 *  查看某玩意是否被关注
 *
 *  @param type         玩意儿的类型
 *  @param objectID     玩意儿的ID
 */
- (void)checkIsFavouritesWithType:(kTCCollectType)type andObjectID:(NSString *)objectID  andSuccessBlocks:(NetDownLoadSuccessBlock)checkSuccess andFailureBlocks:(NetDownLoadFailureBlock)checkFailure;

#pragma mark - 用户信息相关
/**
 *  退出登录
 */
- (void)logoutWithSuccessBlocks:(NetDownLoadSuccessBlock)logoutSuccess andFailureBlocks:(NetDownLoadFailureBlock)logoutFailure;
/**
 *  更换密码
 */
- (void)changePasswordWithNewPD:(NSString *)newPassword andConfirmPassword:(NSString *)confirmPassword andOldPassword:(NSString *)oldPassword andSuccessBlocks:(NetDownLoadSuccessBlock)changeSuccess andFailureBlocks:(NetDownLoadFailureBlock)changeFailure;
/**
 *  获取所有已发布信息的列表
 *
 *  @param pn           页数
 */
- (void)messageListWithPn:(NSString *)pn andSuccessBlocks:(NetDownLoadSuccessArrayBlock)querySuccess andFailureBlocks:(NetDownLoadFailureBlock)queryFailure;
/**
 *  修改用户信息
 *
 *  @param HeadUrl     头像地址
 *  @param NickName    昵称
 */
- (void)userInfoEditWithHeadUrl:(NSString *)HeadUrl andNickName:(NSString *)NickName andSuccessBlocks:(NetDownLoadSuccessBlock)editSuccess andFailureBlocks:(NetDownLoadFailureBlock)editFailure;

#pragma mark - 尾货增改查
/**
 *  添加尾货
 */
- (void)tailGoodsAddWithHeadImageUrls:(NSArray *)HeadImageUrls andBrand:(NSString *)Brand andStandard:(NSString *)Standard andCount:(NSString *)Count andPrice:(NSString *)Price andLinkMan:(NSString *)LinkMan andContactNumber:(NSString *)ContactNumber andCompanyAddress:(NSString *)CompanyAddress andType:(NSString *)Type andBrowseNumber:(NSString *)BrowseNumber andLatitude:(NSString *)Latitude andLongitude:(NSString *)Longitude andUserId:(NSString *)UserId andIsTop:(NSString *)IsTop andCreateTime:(NSString *)CreateTime andState:(NSString *)State andCollectTimes:(NSString *)CollectTimes andAreaId:(NSString *)AreaId andSuccessBlocks:(NetDownLoadSuccessBlock)addSuccess andFailureBlocks:(NetDownLoadFailureBlock)addFailure;

/**
 *  修改尾货
 */
- (void)tailGoodsEditWithID:(NSString *)Id andHeadImageUrls:(NSArray *)HeadImageUrls andBrand:(NSString *)Brand andStandard:(NSString *)Standard andCount:(NSString *)Count andPrice:(NSString *)Price andLinkMan:(NSString *)LinkMan andContactNumber:(NSString *)ContactNumber andCompanyAddress:(NSString *)CompanyAddress andType:(NSString *)Type andBrowseNumber:(NSString *)BrowseNumber andLatitude:(NSString *)Latitude andLongitude:(NSString *)Longitude andUserId:(NSString *)UserId andIsTop:(NSString *)IsTop andCreateTime:(NSString *)CreateTime andState:(NSString *)State andCollectTimes:(NSString *)CollectTimes andAreaId:(NSString *)AreaId andSuccessBlocks:(NetDownLoadSuccessIdBlock)editSuccess andFailureBlocks:(NetDownLoadFailureBlock)editFailure;

/**
 *  根据id设置尾货置顶
 */
- (void)tailGoodsTopWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessBlock)topSuccess andFailureBlocks:(NetDownLoadFailureBlock)topFailure;

/**
 *  根据id删除尾货信息
 */
- (void)tailGoodsDeleteWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessBlock)deleteSuccess andFailureBlocks:(NetDownLoadFailureBlock)deleteFailure;

#pragma mark - 招聘增改查
/**
 *  增加招聘信息
 */
- (void)recruitmentAddWithId:(NSString *)Id andTitle:(NSString *)Title andWage:(NSString *)Wage andAddress:(NSString *)Address andPosition:(NSString *)Position andContactNumber:(NSString *)ContactNumber andRequirements:(NSString *)Requirements andCompanyName:(NSString *)CompanyName andCompanyScale:(NSString *)CompanyScale andCompanyFeature:(NSString *)CompanyFeature andLatitude:(NSString *)Latitude andLongitude:(NSString *)Longitude andState:(NSString *)State andCreateTime:(NSString *)CreateTime andIsTop:(NSString *)IsTop andUserId:(NSString *)UserId andBrowseNumber:(NSString *)BrowseNumber andCollectTimes:(NSString *)CollectTimes andAreaId:(NSString *)AreaId andWelfares:(NSDictionary *)Welfares andSuccessBlocks:(NetDownLoadSuccessBlock)addSuccess andFailureBlocks:(NetDownLoadFailureBlock)addFailure;
/**
 *  修改招聘信息
 */
- (void)recruitmentEditWithId:(NSString *)Id andTitle:(NSString *)Title andWage:(NSString *)Wage andAddress:(NSString *)Address andPosition:(NSString *)Position andContactNumber:(NSString *)ContactNumber andRequirements:(NSString *)Requirements andCompanyName:(NSString *)CompanyName andCompanyScale:(NSString *)CompanyScale andCompanyFeature:(NSString *)CompanyFeature andLatitude:(NSString *)Latitude andLongitude:(NSString *)Longitude andState:(NSString *)State andCreateTime:(NSString *)CreateTime andIsTop:(NSString *)IsTop andUserId:(NSString *)UserId andBrowseNumber:(NSString *)BrowseNumber andCollectTimes:(NSString *)CollectTimes andAreaId:(NSString *)AreaId andWelfares:(NSDictionary *)Welfares andSuccessBlocks:(NetDownLoadSuccessIdBlock)editSuccess andFailureBlocks:(NetDownLoadFailureBlock)editFailure;
/**
 *  删除招聘信息
 *
 *  @param ID            招聘信息编号
 */
- (void)RecruitmentDeleteWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessBlock)deleteSuccess andFailureBlocks:(NetDownLoadFailureBlock)deleteFailure;
/**
 *  招聘信息置顶
 *
 *  @param ID          招聘信息编号
 */
- (void)recruitmentTopWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessBlock)topSuccess andFailureBlocks:(NetDownLoadFailureBlock)topFailure;

#pragma mark - 商铺增改查
/**
 *  发布商铺
 */
- (void)rentAddWithID:(NSString *)ID andTitle:(NSString *)title andPrice:(NSString *)price andArea:(NSString *)area andType:(NSString *)type andClostTo:(NSString *)closeTo andHistory:(NSString *)history andAddress:(NSString *)address andDescription:(NSString *)description andImageUrls:(NSArray *)ImageUrls andBrowseCount:(NSString *)browseCount andLatitude:(NSString *)Latitude andLongitude:(NSString *)Longitude andIsTop:(NSString *)IsTop andUserID:(NSString *)userID andCreatTime:(NSString *)createTime andState:(NSString *)State andAreaId:(NSString *)AreaId andCollectTimes:(NSString *)CollectTimes andLinkMan:(NSString *)linkMan andContractNum:(NSString *)contractNum SuccessBlocks:(NetDownLoadSuccessBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  修改商铺
 */
- (void)rentEditWithID:(NSString *)ID andTitle:(NSString *)title andPrice:(NSString *)price andArea:(NSString *)area andType:(NSString *)type andClostTo:(NSString *)closeTo andHistory:(NSString *)history andAddress:(NSString *)address andDescription:(NSString *)description andImageUrls:(NSArray *)ImageUrls andBrowseCount:(NSString *)browseCount andLatitude:(NSString *)Latitude andLongitude:(NSString *)Longitude andIsTop:(NSString *)IsTop andUserID:(NSString *)userID andCreatTime:(NSString *)createTime andState:(NSString *)State andAreaId:(NSString *)AreaId andCollectTimes:(NSString *)CollectTimes andLinkMan:(NSString *)linkMan andContractNum:(NSString *)contractNum SuccessBlocks:(NetDownLoadSuccessIdBlock)editSuccess andFailureBlocks:(NetDownLoadFailureBlock)editFailure;
/**
 *  删除商铺信息
 *
 *  @param ID            商铺编号
 */
- (void)rentDeleteWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessBlock)deleteSuccess andFailureBlocks:(NetDownLoadFailureBlock)deleteFailure;
/**
 *  商铺置顶
 *
 *  @param ID          商铺编号
 */
- (void)rentTopWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessBlock)topSuccess andFailureBlocks:(NetDownLoadFailureBlock)topFailure;

#pragma mark - 市场相关
/**
 *  根据市场ID获取市场详情
 */
- (void)MarketDetailWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessIdBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

#pragma mark - 公司相关
/**
 *  根据公司ID获取公司详情(他和市场数据一样 所以都用marketModel)
 */
- (void)GetCompanyWithID:(NSString * )ID andSuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  传入品牌 搜索所有相关公司
 */
- (void)CompanyListWithBrand:(NSString *)brand andPN:(NSString *)pn andSuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  获取推荐的公司列表
 */
- (void)PushCompanyListWithSuccessBlocks:(NetDownLoadSuccessArrayBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;
/**
 *  获取招聘信息详情
 */
- (void)RecruitmentDetailWithID:(NSString *)ID andSuccessBlocks:(NetDownLoadSuccessDicBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;

/**
 *  获取分享内容
 */
- (void)getShareInfoSuccessBlocks:(NetDownLoadSuccessBlock)success andFailureBlocks:(NetDownLoadFailureBlock)failure;



@end
